#ifndef PROMENIDELEGATE_H
#define PROMENIDELEGATE_H

#include "promenieditor.h"
#include <QStyledItemDelegate>

class PromeniEditor;

class PromeniDelegate : public QStyledItemDelegate
{
    Q_OBJECT

public:
    PromeniDelegate(QWidget *parent = 0);
    ~PromeniDelegate();
    QString displayText(const QVariant &value, const QLocale &locale) const;
    QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;

    QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
//    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;

private slots:
    void commitAndCloseEditor();

};

#endif // PROMENIDELEGATE_H
